package main

import "fmt"

type address1 struct {
	province   string
	city       string
	updateTime string
}

type email1 struct {
	addr       string
	updateTime string
}
type person5 struct {
	name     string
	gender   string
	age      int
	address1 // 嵌套结构体address1
	email1   // 嵌套结构体email1

}

func main() {
	p1 := person5{
		name:   "小王子",
		gender: "男",
		age:    18,
		address1: address1{
			province:   "山东",
			city:       "威海",
			updateTime: "2019-7-11",
		},
		email1: email1{
			addr:       "hello@hello.com",
			updateTime: "2018-9-8",
		},
	}
	fmt.Printf("%#v\n", p1)
	fmt.Println(p1.name, p1.gender, p1.age, p1.address1)
	// fmt.Println(p1.updateTime) // 嵌套结构体中包含多个同名的updateTime字段
	fmt.Println(p1.address1.updateTime)
	fmt.Println(p1.email1.updateTime)
}
